package com.gjy.sb.plugin;

import org.apache.ibatis.executor.Executor;
import org.apache.ibatis.mapping.MappedStatement;
import org.apache.ibatis.plugin.Interceptor;
import org.apache.ibatis.plugin.Intercepts;
import org.apache.ibatis.plugin.Invocation;
import org.apache.ibatis.plugin.Signature;
import org.apache.ibatis.session.ResultHandler;
import org.apache.ibatis.session.RowBounds;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author 宫静雨
 * @version 1.0
 * @since 2023-12-06 13:41:13
 */
@Intercepts({
        @Signature(type = Executor.class, method = "query", args = {MappedStatement.class, Object.class, RowBounds.class, ResultHandler.class})
})
public class MyInterceptor2 implements Interceptor {

    private static final Logger log = LoggerFactory.getLogger(MyInterceptor2.class);

    @Override
    public Object intercept(Invocation invocation) throws Throwable {
        log.info("---------------------------------------------");
        log.info("--------MyInterceptor2--------");
        log.info("---------------------------------------------");
        return invocation.proceed();
    }

}
